fi will be opened for input, fo will be opened for output